<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>账号变更</title>
    <link
      rel="stylesheet"
      href="../static/bootstrap/css/bootstrap.min.css"
      th:href="@{/static/bootstrap/css/bootstrap.min.css}"
    />
    <link
      rel="stylesheet"
      href="../static/css/global.css"
      th:href="@{/static/css/global.css}"
    />
    <link
      rel="stylesheet"
      href="../static/css/patient.css"
      th:href="@{/static/css/patient.css}"
    />
  </head>
  <body>
    <main class="mainBox" th:fragment="accountChange">
      <!-- Modal -->
      <div
        class="modal fade"
        id="exampleModal"
        tabindex="-1"
        aria-labelledby="exampleModalLabel"
        aria-hidden="true"
      >
        <div class="modal-dialog">
          <div class="modal-content">
            <div class="modal-header">
              <h1 class="modal-title fs-5" id="exampleModalLabel">确认框</h1>
              <button
                type="button"
                class="btn-close"
                data-bs-dismiss="modal"
                aria-label="Close"
              ></button>
            </div>
            <div class="modal-body">您确定要进行此操作吗？</div>
            <div class="modal-footer">
              <button
                type="button"
                class="btn btn-secondary"
                data-bs-dismiss="modal"
              >
                取消
              </button>
              <button type="button" class="btn btn-primary">
                <a th:href="@{/admin/accountInfo/reset}">确认</a>
              </button>
            </div>
          </div>
        </div>
      </div>
      <!-- content -->
      <div class="container shadow-md-sm">
        <div>
          <div
            class="container d-flex justify-content-between align-items-center labelBox"
          >
            <strong>账号更改</strong>
            <div>
              <button
                th:if="${accountInfo == 'onshow'}"
                type="button"
                class="btn btn-outline-secondary btn-sm"
              >
                <a th:href="@{/admin/accountInfo?update='true'}">修改</a>
              </button>
              <button
                th:if="${accountInfo == 'change'}"
                type="button"
                class="btn btn-outline-primary btn-sm"
              >
                <a th:href="@{/admin/accountInfo}">取消</a>
              </button>
              <button
                th:if="${accountInfo == 'change'}"
                type="submit"
                form="identifyForm"
                class="btn btn-outline-primary btn-sm"
              >
                保存
              </button>
            </div>
          </div>
          <form
            action="/admin/accountInfo/update"
            method="post"
            id="identifyForm"
            class="container"
          >
            <div class="row justify-content-center mb-3 label">
              <label for="account" class="col-3 col-md-1 col-form-label">
                账户
              </label>
              <div class="col-8 col-md-7" th:switch="${accountInfo}">
                <p th:case="onshow" class="form-control-plaintext">
                  [[${admin}!=null?${admin.account}:null]]
                </p>
                <input
                  th:case="change"
                  type="text"
                  class="form-control"
                  name="account"
                  th:value="${admin}!=null?${admin.account}:null"
                />
              </div>
            </div>

            <div class="row justify-content-center mb-3">
              <label for="password" class="col-3 col-md-1 col-form-label">
                密码
              </label>
              <div class="col-8 col-md-7" th:switch="${accountInfo}">
                <p th:case="onshow" class="form-control-plaintext">
                  [[${admin}!=null?${admin.password}:null]]
                </p>
                <input
                  th:case="change"
                  name="password"
                  type="password"
                  class="form-control"
                  th:value="${admin}!=null?${admin.password}:null"
                />
              </div>
            </div>
          </form>
        </div>
        <div>
          <div
            class="container d-flex justify-content-between align-items-center labelBox"
          >
            <strong>账号重置</strong>
            <div>
              <button
                type="button"
                class="btn btn-outline-secondary btn-sm"
                data-bs-toggle="modal"
                data-bs-target="#exampleModal"
              >
                重置
              </button>
            </div>
          </div>
          <form action="#" method="post" id="identifyForm" class="container">
            <div class="row justify-content-center mb-3 label">
              <label for="idcard" class="col-3 col-md-1 col-form-label">
                身份证
              </label>
              <div class="col-8 col-md-7">
                <p class="form-control-plaintext">
                  [[${admin}!=null?${admin.idcard}:null]]
                </p>
              </div>
            </div>
          </form>
        </div>
      </div>
    </main>
    <script
      src="../static/bootstrap/js/bootstrap.bundle.min.js"
      th:src="@{/static/bootstrap/js/bootstrap.bundle.min.js}"
    ></script>
  </body>
</html>
